package inject

import (
	"gitee.com/kordar/layuiadmin/admin/repository"
	"gitee.com/kordar/layuiadmin/admin/service/impl"
	digstarter "github.com/kordar/dig-starter"
	"github.com/kordar/gocrud"
)

func ServiceProvider() {

	digstarter.ProvideE(func(db GoAdminDB, adminRepos *repository.AdminRepository) (ServiceResult, error) {
		adminServiceImpl := impl.NewAdminService(db.DB, adminRepos)
		return ServiceResult{
			AdminService: adminServiceImpl,
			ResourceService: []gocrud.ResourceService{
				adminServiceImpl,
			},
		}, nil
	})

}
